<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Private Adverts Saddles | Buy Saddles Online</title>

<meta name="description" content="Buy private saddles online | Sell horse saddles online | Also view our large range of saddles for most disciplines including General Purpose | Dressage | Eventing | Working | Hunter and VSD. Buy or sell saddles online." />

<link href="css/main.css" rel="stylesheet" type="text/css" />
<style type="text/css">
body {
	background-image: url(images/background.jpg);
	background-repeat: repeat-x;
	background-position: center top;
	background-attachment: fixed;
	margin: 0px;
	padding: 0px;
}
</style>

<link href="css/saddleShop.css" rel="stylesheet" type="text/css" />
<link href="css/paginate.css" rel="stylesheet" type="text/css" />
</head>

<body onload="MM_preloadImages('images/facebookHover.png')">



<?php include "header.php"; ?>

<div id="content">

<div id="catagoryInformation">

<h1>Private Horse Saddles</h1>

<h2>Second Hand Saddles | Used Saddle Range</h2>

<p>Below you can find our range of quality second hand, used horse saddles. All of our saddles are available for delivery throughout UK or for collection from Croft, Warrington. 24-7 Saddles offer  saddles from a variety of makes such as: 
<br /><br />
<b>Albion </b> saddles, <b>Whitaker</b>  saddles, <b>Prestige</b>  saddles, <b>Amerigo</b>  saddles, <b>Gfs</b>  saddles, <b>Wintec</b>  saddles, <b>Bates</b>  saddles, <b>Derby</b> House  saddles, <b>Jeffries</b>  saddles, <b>Stubben</b>  saddles, <b>Kieffer</b>  saddles, <b>Paul Jones</b>  saddles, <b>Ideal</b>  saddles, <b>Pessoa</b>  saddles, <b>Dever</b>  saddles, <b>Sandringham</b>  saddles, <b>Cliff Barnsby</b>  saddles, <b>Colligiate</b>  saddles, <b>Silhouette</b>  saddles, <b>Oakfield</b>  saddles and <b>Farringtons</b>  saddles.
<br /><br />
Looking to get rid of your old saddle, look no further. 24-7 Saddles can put you saddle infront of a large customer base, this increasing the chance of selling your saddle which you may have been struggling to sell. Contact us to discuss advertising your saddle online with our team. <a href="termsAndConditions.php" class="p_Link">Click here</a> to view the terms and conditions for selling your saddle with us.
<br /><br />
View all of our saddles below.</p>

</div>

<?php
	include('connect.php');	

	$tableName="products";		
	$targetpage = "saddleShop - PrivateAdverts.php"; 	
	$limit = 5; 
	
	$query = "SELECT COUNT(*) as num FROM $tableName WHERE productCategory = 'Private Adverts'";
	$total_pages = mysql_fetch_array(mysql_query($query));
	$total_pages = $total_pages[num];
	
	$stages = 3;
	$page = mysql_escape_string($_GET['page']);
	if($page){
		$start = ($page - 1) * $limit; 
	}else{
		$start = 0;	
		}	
	
    // Get page data
	$query1 = "SELECT * FROM $tableName WHERE productCategory = 'Private Adverts' LIMIT $start, $limit";
	$result = mysql_query($query1);
	
	// Initial page num setup
	if ($page == 0){$page = 1;}
	$prev = $page - 1;	
	$next = $page + 1;							
	$lastpage = ceil($total_pages/$limit);		
	$LastPagem1 = $lastpage - 1;					
	
	
	$paginate = '';
	if($lastpage > 1)
	{	
	

	
	
		$paginate .= "<div class='paginate'>";
		// Previous
		if ($page > 1){
			$paginate.= "<a href='$targetpage?page=$prev'>previous</a>";
		}else{
			$paginate.= "<span class='disabled'>previous</span>";	}
			

		
		// Pages	
		if ($lastpage < 7 + ($stages * 2))	// Not enough pages to breaking it up
		{	
			for ($counter = 1; $counter <= $lastpage; $counter++)
			{
				if ($counter == $page){
					$paginate.= "<span class='current'>$counter</span>";
				}else{
					$paginate.= "<a href='$targetpage?page=$counter'>$counter</a>";}					
			}
		}
		elseif($lastpage > 5 + ($stages * 2))	// Enough pages to hide a few?
		{
			// Beginning only hide later pages
			if($page < 1 + ($stages * 2))		
			{
				for ($counter = 1; $counter < 4 + ($stages * 2); $counter++)
				{
					if ($counter == $page){
						$paginate.= "<span class='current'>$counter</span>";
					}else{
						$paginate.= "<a href='$targetpage?page=$counter'>$counter</a>";}					
				}
				$paginate.= "...";
				$paginate.= "<a href='$targetpage?page=$LastPagem1'>$LastPagem1</a>";
				$paginate.= "<a href='$targetpage?page=$lastpage'>$lastpage</a>";		
			}
			// Middle hide some front and some back
			elseif($lastpage - ($stages * 2) > $page && $page > ($stages * 2))
			{
				$paginate.= "<a href='$targetpage?page=1'>1</a>";
				$paginate.= "<a href='$targetpage?page=2'>2</a>";
				$paginate.= "...";
				for ($counter = $page - $stages; $counter <= $page + $stages; $counter++)
				{
					if ($counter == $page){
						$paginate.= "<span class='current'>$counter</span>";
					}else{
						$paginate.= "<a href='$targetpage?page=$counter'>$counter</a>";}					
				}
				$paginate.= "...";
				$paginate.= "<a href='$targetpage?page=$LastPagem1'>$LastPagem1</a>";
				$paginate.= "<a href='$targetpage?page=$lastpage'>$lastpage</a>";		
			}
			// End only hide early pages
			else
			{
				$paginate.= "<a href='$targetpage?page=1'>1</a>";
				$paginate.= "<a href='$targetpage?page=2'>2</a>";
				$paginate.= "...";
				for ($counter = $lastpage - (2 + ($stages * 2)); $counter <= $lastpage; $counter++)
				{
					if ($counter == $page){
						$paginate.= "<span class='current'>$counter</span>";
					}else{
						$paginate.= "<a href='$targetpage?page=$counter'>$counter</a>";}					
				}
			}
		}
					
				// Next
		if ($page < $counter - 1){ 
			$paginate.= "<a href='$targetpage?page=$next'>next</a>";
		}else{
			$paginate.= "<span class='disabled'>next</span>";
			}
			
		$paginate.= "</div>";		
	
	
}

 // pagination
 echo $paginate;
?>

<?php 
 
		//Create the products on the web page
		while($row = mysql_fetch_array($result))
		{
		
		 echo  '
  		<form action="productDetails.php" method="post" name="productDetails">
		<input name="productID" type="hidden" value="'.$row['productID'].'" />
 		<div id="productContainer">
		<h3>'.$row['productName'].'</h3>
		<p id="price">£'.$row['productCost'].'</p>
    	<p id="productDetailsSmall">'.$row['productDescription'].'</p>
    	<input id="viewButton" name="submit" type="submit" value="View Saddle" />
    	<img src="images/saddles/'.$row['productID'].'_1.jpg" width="500" height="438" />';
		
		if ($row['onTrial'] == "Yes") {
		echo '<p id="saddleOnTrial">On Trial</p>';
		}
		
 echo  	'</div>';
 echo   '</form>';
		
  }
	
 echo $paginate;
	
	?>
</ul>

</div>
<!--Content #End-->

<?php include"footer.php" ?>


</body>
</html>